<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.1.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/hexo/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/hexo/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/hexo/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/hexo/images/logo.svg" color="#222">

<link rel="stylesheet" href="/hexo/css/main.css">


<link rel="stylesheet" href="/hexo/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"youchen12138.gitee.io","root":"/hexo/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="input标签type属性新增属性值   属性值 作用    tel 手机端不同   email 手机端键盘出现@   number 出现按钮，可以加减   url 手机端键盘出现.com   Date 选取日、月、年   Month 选取月、年   Week 选取周和年 不实用   Time 选取时间（小时和分钟）   Datatime 选取时间、日、月、年（UTC时间） 不实用   Datat">
<meta property="og:type" content="article">
<meta property="og:title" content="HTML进阶知识点--HTML5属性变化">
<meta property="og:url" content="https://youchen12138.gitee.io/hexo/2020/08/27/HTML%E8%BF%9B%E9%98%B6%E7%9F%A5%E8%AF%86%E7%82%B9-HTML5%E5%B1%9E%E6%80%A7%E5%8F%98%E5%8C%96/index.html">
<meta property="og:site_name" content="幽辰的博客">
<meta property="og:description" content="input标签type属性新增属性值   属性值 作用    tel 手机端不同   email 手机端键盘出现@   number 出现按钮，可以加减   url 手机端键盘出现.com   Date 选取日、月、年   Month 选取月、年   Week 选取周和年 不实用   Time 选取时间（小时和分钟）   Datatime 选取时间、日、月、年（UTC时间） 不实用   Datat">
<meta property="og:locale" content="en_US">
<meta property="article:published_time" content="2020-08-27T10:05:22.000Z">
<meta property="article:modified_time" content="2020-08-27T10:06:59.074Z">
<meta property="article:author" content="幽辰">
<meta property="article:tag" content="HTML">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://youchen12138.gitee.io/hexo/2020/08/27/HTML%E8%BF%9B%E9%98%B6%E7%9F%A5%E8%AF%86%E7%82%B9-HTML5%E5%B1%9E%E6%80%A7%E5%8F%98%E5%8C%96/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'en'
  };
</script>

  <title>HTML进阶知识点--HTML5属性变化 | 幽辰的博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="Toggle navigation bar">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/hexo/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">幽辰的博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/hexo/" rel="section"><i class="fa fa-home fa-fw"></i>Home</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/hexo/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>Tags<span class="badge">23</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/hexo/categories/" rel="section"><i class="fa fa-th fa-fw"></i>Categories<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/hexo/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>Archives<span class="badge">127</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="en">
    <link itemprop="mainEntityOfPage" href="https://youchen12138.gitee.io/hexo/2020/08/27/HTML%E8%BF%9B%E9%98%B6%E7%9F%A5%E8%AF%86%E7%82%B9-HTML5%E5%B1%9E%E6%80%A7%E5%8F%98%E5%8C%96/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/hexo/images/avatar.jpg">
      <meta itemprop="name" content="幽辰">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="幽辰的博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          HTML进阶知识点--HTML5属性变化
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">Posted on</span>
              

              <time title="Created: 2020-08-27 18:05:22 / Modified: 18:06:59" itemprop="dateCreated datePublished" datetime="2020-08-27T18:05:22+08:00">2020-08-27</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">In</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/hexo/categories/HTML/" itemprop="url" rel="index"><span itemprop="name">HTML</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="input标签type属性新增属性值"><a href="#input标签type属性新增属性值" class="headerlink" title="input标签type属性新增属性值"></a>input标签type属性新增属性值</h2><table>
<thead>
<tr>
<th>属性值</th>
<th>作用</th>
</tr>
</thead>
<tbody><tr>
<td>tel</td>
<td>手机端不同</td>
</tr>
<tr>
<td>email</td>
<td>手机端键盘出现@</td>
</tr>
<tr>
<td>number</td>
<td>出现按钮，可以加减</td>
</tr>
<tr>
<td>url</td>
<td>手机端键盘出现<code>.com</code></td>
</tr>
<tr>
<td>Date</td>
<td>选取日、月、年</td>
</tr>
<tr>
<td>Month</td>
<td>选取月、年</td>
</tr>
<tr>
<td>Week</td>
<td>选取周和年 <font color="red">不实用</font></td>
</tr>
<tr>
<td>Time</td>
<td>选取时间（小时和分钟）</td>
</tr>
<tr>
<td>Datatime</td>
<td>选取时间、日、月、年（UTC时间） <font color="red">不实用</font></td>
</tr>
<tr>
<td>Datatime-local</td>
<td>选取时间、日、月、年（本地时间）</td>
</tr>
<tr>
<td>range</td>
<td>一个可拉伸的进度条（pc端）</td>
</tr>
<tr>
<td>search</td>
<td>搜索框（pc端）</td>
</tr>
<tr>
<td>color</td>
<td>颜色选择框（pc端）</td>
</tr>
</tbody></table>
<h2 id="表单新增属性"><a href="#表单新增属性" class="headerlink" title="表单新增属性"></a>表单新增属性</h2><h3 id="autocomplete属性"><a href="#autocomplete属性" class="headerlink" title="autocomplete属性"></a>autocomplete属性</h3><p>form 或 input 域应该拥有自动完成功能</p>
<blockquote>
<p><code>&lt;form autocomplete=&quot;on&quot;&gt;&lt;/form&gt;</code></p>
</blockquote>
<p>注意：autocomplete 适用于 <code>&lt;form&gt;</code> 标签，以及以下类型的 <code>&lt;input&gt;</code> 标签：text、search、url、telephone、email、password、datepickers、range、color</p>
<h3 id="autofocus属性"><a href="#autofocus属性" class="headerlink" title="autofocus属性"></a>autofocus属性</h3><ul>
<li><p>规定在页面加载时，域自动地获取焦点</p>
</li>
<li><p>autofocus 属性适用于所有 <code>&lt;input&gt;</code> 标签的类型</p>
</li>
</ul>
<p>语法：</p>
<blockquote>
<p><code>&lt;input autofocus=&quot;autofocus&gt;</code></p>
</blockquote>
<h3 id="multiple属性"><a href="#multiple属性" class="headerlink" title="multiple属性"></a>multiple属性</h3><p>规定输入域中可选择多个值</p>
<p>PS：multiple 属性适用于以下类型的 <code>&lt;input&gt;</code> 标签：email 和 file</p>
<blockquote>
<p><code>&lt;input type=&quot;file&quot; multiple=&quot;multiple&quot;&gt;</code></p>
</blockquote>
<h3 id="placeholder属性"><a href="#placeholder属性" class="headerlink" title="placeholder属性"></a>placeholder属性</h3><p>提供一种提示（hint），描述输入框所期待的值</p>
<p>PS：适用于 <code>&lt;input&gt;</code> 标签 type 属性值为：text、search、url、tel、email、password</p>
<h3 id="required属性"><a href="#required属性" class="headerlink" title="required属性"></a>required属性</h3><p>规定必须在提交之前填写输入域（不能为空）</p>
<blockquote>
<p><code>&lt;input type=&quot;text&quot; required=&quot;required&quot;&gt;</code></p>
</blockquote>
<p>减少前端开发人员写表单验证的压力</p>
<p>PS：适用于 <code>&lt;input&gt;</code> 标签 type 属性值为：text、search、url、tel、email、password、datepickers、number、checkbox、radio、file</p>
<h2 id="链接新增属性"><a href="#链接新增属性" class="headerlink" title="链接新增属性"></a>链接新增属性</h2><ol>
<li><p><code>&lt;link&gt;</code> 的sizes</p>
</li>
<li><p><code>&lt;base&gt;</code> 的target</p>
<ul>
<li>base 标签如果设置了 target 属性，就可以控制整个页面所有超链接的跳转方式</li>
</ul>
</li>
<li><p><code>&lt;a&gt;</code> 标签</p>
<ul>
<li><p>media = “”（表示对设备进行优化，handheld 对“手持”设备进行支持，tv 对“电视”设备进行支持</p>
</li>
<li><p>hreflang = “zh”（设置语言，这里设置语言是中文）</p>
</li>
<li><p>rel = “external”（设置超链接的引用，这里超链接为外部链接）</p>
</li>
</ul>
</li>
</ol>
<h2 id="其他属性"><a href="#其他属性" class="headerlink" title="其他属性"></a>其他属性</h2><h3 id="script"><a href="#script" class="headerlink" title="script"></a>script</h3><ul>
<li><p>defer：规定当页面已完成加载后，才会执行脚本</p>
</li>
<li><p>async：规定一旦脚本可用，将会异步执行</p>
</li>
</ul>
<h3 id="ol"><a href="#ol" class="headerlink" title="ol"></a>ol</h3><table>
<thead>
<tr>
<th>属性</th>
<th>作用</th>
</tr>
</thead>
<tbody><tr>
<td>start</td>
<td>起始值</td>
</tr>
<tr>
<td>reversed</td>
<td>倒序排列</td>
</tr>
</tbody></table>
<h3 id="html"><a href="#html" class="headerlink" title="html"></a>html</h3><p>manifest = “cache.manifest”（定义页面离线应用文件）（引号中内容cache可更改）</p>
<blockquote>
<p><code>&lt;html manifest=&quot;cache.manifest&quot;&gt;</code></p>
</blockquote>
<h3 id="style"><a href="#style" class="headerlink" title="style"></a>style</h3><p>scoped：内嵌CSS</p>
<p>可以写在html文件的任意位置</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&lt;style scoped&gt;</span><br><span class="line">    ...</span><br><span class="line">&lt;&#x2F;style&gt;</span><br></pre></td></tr></table></figure>
    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/hexo/tags/HTML/" rel="tag"># HTML</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/hexo/2020/08/26/Flutter-Animation%EF%BC%88%E5%8A%A8%E7%94%BB%EF%BC%89/" rel="prev" title="Flutter-Animation（动画）">
      <i class="fa fa-chevron-left"></i> Flutter-Animation（动画）
    </a></div>
      <div class="post-nav-item">
    <a href="/hexo/2020/08/28/webapp%E9%80%82%E9%85%8D-%E5%9F%BA%E7%A1%80%E6%A6%82%E5%BF%B5/" rel="next" title="webapp适配--基础概念">
      webapp适配--基础概念 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          Table of Contents
        </li>
        <li class="sidebar-nav-overview">
          Overview
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#input%E6%A0%87%E7%AD%BEtype%E5%B1%9E%E6%80%A7%E6%96%B0%E5%A2%9E%E5%B1%9E%E6%80%A7%E5%80%BC"><span class="nav-number">1.</span> <span class="nav-text">input标签type属性新增属性值</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%A1%A8%E5%8D%95%E6%96%B0%E5%A2%9E%E5%B1%9E%E6%80%A7"><span class="nav-number">2.</span> <span class="nav-text">表单新增属性</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#autocomplete%E5%B1%9E%E6%80%A7"><span class="nav-number">2.1.</span> <span class="nav-text">autocomplete属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#autofocus%E5%B1%9E%E6%80%A7"><span class="nav-number">2.2.</span> <span class="nav-text">autofocus属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#multiple%E5%B1%9E%E6%80%A7"><span class="nav-number">2.3.</span> <span class="nav-text">multiple属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#placeholder%E5%B1%9E%E6%80%A7"><span class="nav-number">2.4.</span> <span class="nav-text">placeholder属性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#required%E5%B1%9E%E6%80%A7"><span class="nav-number">2.5.</span> <span class="nav-text">required属性</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%93%BE%E6%8E%A5%E6%96%B0%E5%A2%9E%E5%B1%9E%E6%80%A7"><span class="nav-number">3.</span> <span class="nav-text">链接新增属性</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%85%B6%E4%BB%96%E5%B1%9E%E6%80%A7"><span class="nav-number">4.</span> <span class="nav-text">其他属性</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#script"><span class="nav-number">4.1.</span> <span class="nav-text">script</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ol"><span class="nav-number">4.2.</span> <span class="nav-text">ol</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#html"><span class="nav-number">4.3.</span> <span class="nav-text">html</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#style"><span class="nav-number">4.4.</span> <span class="nav-text">style</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="幽辰"
      src="/hexo/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">幽辰</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/hexo/archives/">
        
          <span class="site-state-item-count">127</span>
          <span class="site-state-item-name">posts</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/hexo/categories/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">categories</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/hexo/tags/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">tags</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">幽辰</span>
</div>
  <div class="powered-by">Powered by <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a>
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/hexo/lib/anime.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.min.js"></script>
  <script src="/hexo/lib/velocity/velocity.ui.min.js"></script>

<script src="/hexo/js/utils.js"></script>

<script src="/hexo/js/motion.js"></script>


<script src="/hexo/js/schemes/pisces.js"></script>


<script src="/hexo/js/next-boot.js"></script>




  















  

  

</body>
</html>
